import type { App } from 'vue'
import { createRouter, createWebHistory } from 'vue-router'
import basicRoutes from './base'

const router = createRouter({
  history: createWebHistory(),
  scrollBehavior: () => ({ el: 'body', top: 0 }),
  routes: [...basicRoutes]
})

export default async (app: App) => {
  await app.use(router)
  // await router.isReady()
  return { 'vue-router': router }
}
